package com.cet.others;

import edu.princeton.cs.algs4.Bag;
import edu.princeton.cs.algs4.Queue;
import edu.princeton.cs.algs4.Stack;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-03-12 10:43
 **/
public class test {
    public static void main(String[] args) {
        Bag<Integer> bag = new Bag<Integer>();
        bag.add(1);
        bag.add(2);
        bag.add(3);
        bag.add(4);
        bag.add(5);
        System.out.println("背包输出：");
        System.out.println("=============");
        for (Integer i : bag) {
            System.out.println(i);
        }

        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        System.out.println("栈输出：");
        System.out.println("=============");
        for (Integer i : stack) {
            System.out.println(i);
        }

        Queue<Integer> queue = new Queue<>();
        queue.enqueue(1);
        queue.enqueue(2);
        queue.enqueue(3);
        queue.enqueue(4);
        queue.enqueue(5);
        System.out.println("队列输出：");
        System.out.println("=============");
        for (Integer i : queue) {
            System.out.println(i);
        }
    }
}
